package di

import (
	"fmt"
	"git.mycaigou.com/gfyx/micro-gfyx-oppty-service/server/aggregation"
	"git.mycaigou.com/gfyx/micro-gfyx-oppty-service/server/base"
	"git.mycaigou.com/gfyx/micro-gfyx-oppty-service/server/business_opportunity"
	"git.mycaigou.com/gfyx/micro-gfyx-oppty-service/server/clue"
	"git.mycaigou.com/gfyx/micro-gfyx-oppty-service/server/common"
	"git.mycaigou.com/gfyx/micro-gfyx-oppty-service/server/job_center"
	"git.mycaigou.com/gfyx/micro-gfyx-oppty-service/server/market"
	"git.mycaigou.com/gfyx/micro-gfyx-oppty-service/server/rpa"
)

func (c *Inject) InjectServer() {

	servers := []interface{}{
		base.NewLogin,
		base.NewProfitServer,
		base.NewSiteServer,
		base.NewBaseAreaServer,
		base.NewBaseOrgServer,
		base.NewBaseMsgServer,
		base.NewBaseRoleServer,
		base.NewBaseUserServer,
		base.NewMenuServer,
		business_opportunity.NewContact,
		business_opportunity.NewCustomerServer,
		business_opportunity.NewOpptyStatusServer,
		business_opportunity.NewOrderServer,
		business_opportunity.NewSubscriptionServer,
		business_opportunity.NewProjectServer,
		business_opportunity.NewBidServer,
		business_opportunity.NewBuildingServer,
		business_opportunity.NewStrategicMonitorServer,
		clue.NewCustomerManageServer,
		clue.NewClueServer,
		clue.NewReport,
		common.NewDmpReportServer,
		common.NewFileServer,
		common.NewFormServer,
		common.NewOptionServer,
		common.NewVerifyCodeServer,
		market.NewOutboundAccountServer,
		market.NewOutboundCrowdServer,
		market.NewOutboundTaskServer,
		rpa.NewRpaConfigServer,
		rpa.NewRpaStartServer,
		job_center.NewJobCenterServer,
		aggregation.NewStatisticsServer,
	}
	var errs []error
	for _, constructor := range servers {
		err := c.Provide(constructor)
		if err != nil {
			errs = append(errs, err)
		}
	}

	fmt.Printf("InjectServer errors:%+v\n", errs)
}
